

package jetbrains.buildServer.server.rest.errors.serverSide;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
import jetbrains.buildServer.server.rest.jersey.ExceptionMapperBase;
import jetbrains.buildServer.serverSide.DuplicateTemplateNameException;
import org.jetbrains.annotations.NotNull;

@Provider
public class DuplicateTemplateNameExceptionMapper extends ExceptionMapperBase<DuplicateTemplateNameException> {
  @Override
  public ResponseData getResponseData(@NotNull DuplicateTemplateNameException e) {
    return new ResponseData(Response.Status.BAD_REQUEST, e.getMessage());
  }
}